package com.eugeneMa.entity;

import com.eugeneMa.enumEntity.ErrorMsg;

/**
 * 封装返回结果类
 *
 * @author Eugenema
 * @date 2022/1/2 16:21
 */
public class Result {
    /** 执行结果 */
    private Boolean flag;
    /** 负载信息 */
    private Object data;
    /** 异常信息 */
    private ErrorMsg errorMsg;

    /**
     * 全参构造
     *
     * @author Eugenema
     * @date 2022/3/31 23:12
     *
     **/
    public Result(Boolean flag, Object data, ErrorMsg errorMsg) {
        this.flag = flag;
        this.data = data;
        this.errorMsg = errorMsg;
    }

    public Boolean getFlag() {
        return flag;
    }

    public void setFlag(Boolean flag) {
        this.flag = flag;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getErrorMsg() {
        return errorMsg == null ? "" : errorMsg.getContent();
    }

    public void setErrorMsg(ErrorMsg errorMsg) {
        this.errorMsg = errorMsg;
    }
}
